package com.wlf.demo.pageHelper.model.converter;

import com.wlf.demo.pageHelper.model.UserStatus;
import com.wlf.demo.pageHelper.model.dto.UserDTO;
import com.wlf.demo.pageHelper.model.po.User;
import com.wlf.demo.pageHelper.model.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.ValueMapping;
import org.mapstruct.ValueMappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface UserMapper {

    User dtoToPO(UserDTO userDTO);

    UserVO poToVO(User user);

    List<UserVO> poToVO(List<User> user);

    default UserStatus intToUserStatus(Integer userStatus) {
        return UserStatus.valueOf(userStatus);
    }

}
